草庐IT

ios - xcodebuild PRODUCT_NAME

全部标签

c# - 为什么c#内置的IO类比自制的快?

当我决定在C#中自己实现JavaByteBuffer时,我认为它会比MemoryStream+BinaryWriter/二进制阅读器。我通过ILSpy查看了它们的源代码,发现有很多检查和辅助方法调用,而在我的实现中,我直接使用底层字节数组。但是,当测试表明重型内置类的方法调用比我的轻型方法调用快将近两倍时,我感到非常惊讶。例如:publicvoidWriteBytes(Byte[]buffer,Int32offset,Int32count){this.EnsureFreeSpace(count);Buffer.BlockCopy(buffer,offset,this.buffer,th

c# - 异常:指定类别中不存在实例 'Name of instance'

当我像这样创建和使用性能计数器时:privatereadonlyPerformanceCounter_cpuPerformanceCounter;publicProcessViewModel(Processprocess){_cpuPerformanceCounter=newPerformanceCounter("Process","%ProcessorTime",process.ProcessName,true);}publicvoidUpdate(){CPU=(int)_cpuPerformanceCounter.NextValue()/Environment.ProcessorC

c# - 有人使用 .NET 的 System.IO.IsolatedStorage 吗?

我在阅读.NET中的System.IO.IsolatedStorage命名空间时发现我可以使用它来将文件存储到我的程序集或可执行文件的唯一位置。例如下面的代码:usingSystem.IO.IsolatedStorage;publicclassProgram{staticvoidMain(string[]args){IsolatedStorageFilestore=IsolatedStorageFile.GetUserStoreForAssembly();store.CreateFile("myUserFile.txt");}}在以下位置创建文件“myUserFile.txt”:C:\

c# - System.IO.File.Move--如何等待移动完成?

我正在用C#编写一个WPF应用程序,我需要移动一些文件——问题是我真的真的需要知道这些文件是否成功。为此,我写了一个检查以确保文件在移动后到达目标目录——问题是有时我在文件移动完成之前就进行了检查:System.IO.File.Move(file.FullName,endLocationWithFile);System.IO.FileInfo[]filesInDirectory=endLocation.GetFiles();foreach(System.IO.FileInfotempinfilesInDirectory){if(temp.Name==shortFileName){ret

c# - 如何使用 Xamarin 在 iOS 8 中制作表格单元格和分隔符全宽?

我们有许多表格View(使用XamarinMonotouchDialog),它们是普通的(未分组的)并且设计为全角显示而没有缩进。这在iOS7中一切正常。不过使用iOS8模拟器时,我们得到了轻微的左缩进。iOS8有一个名为LayoutMargins的新属性。我们将该属性设置为零。像这样:if(this.TableView.RespondsToSelector(newSelector("setSeparatorInset:")))this.TableView.SeparatorInset=UIEdgeInsets.Zero;if(this.TableView.RespondsToSele

c# - System.IO.Directory.GetFiles 空

当我枚举“C:\Windows\System32\Tasks”时,谁能解释为什么GetFile()为空?System.IO.Directory.GetFiles(@"C:\Windows\System32\Tasks");我检查过这个:VS以管理员身份运行没有抛出异常根目录下有文件我可以(通过资源管理器)将文件复制到另一个文件夹,而且它可以工作 最佳答案 这里的问题是您正在以x86运行程序,它是beingsilentlyredirectedtoanotherfolder里面没有文件。(它将被重定向到C:\Windows\SysWOW

c# - 使用 SmtpClient 发送电子邮件时的故障排除 "Mailbox unavailable. The server response was: Access denied - Invalid HELO name"

我一直在尝试通过C#发送电子邮件。我在Google上搜索了各种示例,并从每个示例和每个人最有可能使用的标准代码中提取了点点滴滴。stringto="receiver@domain.com";stringfrom="sender@domain.com";stringsubject="HelloWorld!";stringbody="HelloBody!";MailMessagemessage=newMailMessage(from,to,subject,body);SmtpClientclient=newSmtpClient("smtp.domain.com");client.Crede

c# - ListBox Groupstyle 显示 : How to design a group name?

我想在列表框中按创建日期对我的项目(图像)进行分组。然后我只使用这段代码:但是当我尝试应用某些样式(即边框)时,我没有显示任何组名。只有边框这是我使用DateTime进行分组的新实现:这是我主窗口中的ICollectionView:ICollectionViewview=CollectionViewSource.GetDefaultView(CollectedFiles);view.GroupDescriptions.Add(newPropertyGroupDescription("DateCreated",newDateTimeToDateConverter()));view.Sor

c# - 将 [Display(Name = "X")] 与枚举一起使用。 MVC3 ASP.Net 中的自定义 HtmlHelper

我正在使用来自另一个stackoverflow问题的代码片段:namespaceMvcHtmlHelpers{publicstaticclasshtmlHelpers{//////Radiobuttonfor:Adaptedtosupportenumlabelsfromdisplayattributes//////////////////publicstaticMvcHtmlStringRadioButtonForEnum(thisHtmlHelperhtmlHelper,Expression>expression){varmetaData=ModelMetadata.FromLamb

c# - Xamarin.iOS ARKit 演示项目错误 : “32-bit architectures are not supported when deployment target is 11 or later"

从https://developer.xamarin.com/samples/monotouch/ios11/ARKitSample/部署ARKit示例项目时,我收到构建错误Invalidarchitecture:ARMv7。当部署目标为11或更高版本时,不支持32位架构。所有与部署设备和我的开发机器一起检查:我在部署设备上运行iOS11(iPhone6SPlus-ARKit不会在模拟器中运行),并且安装了Xcode9(并且在启动VisualStudioforMac之前启动过一次)。VisualStudioforMac也已更新到最新的稳定版本(ARKit目前在Alpha和Beta版本中